import request from '@/utils/request';

// 慰问品活动列表
export const getGiftList = (params) => {
  return request({
    url: '/gifts/collect/list',
    method: 'get',
    params: params,
  });
};

// 慰问品活动信息
export const getGiftInfo = (id, params) => {
  return request({
    url: `/gifts/collect/getInfo/${id}`,
    method: 'get',
    params: params,
  });
};

// 保存慰问品活动
export const addGift = (data) => {
  return request({
    url: '/gifts/collect/add',
    method: 'post',
    data,
  });
};

// 修改慰问品活动
export const editGift = (data) => {
  return request({
    url: '/gifts/collect/edit',
    method: 'put',
    data,
  });
};

// 慰问品选项列表
export const getGiftOptionList = (params) => {
  return request({
    url: '/gifts/option/list',
    method: 'get',
    params: params,
  });
};

// 慰问品选项信息
export const getGiftOptionInfo = (id, params) => {
  return request({
    url: `/gifts/option/getInfo/${id}`,
    method: 'get',
    params: params,
  });
};

// 保存慰问品选项
export const addGiftOption = (data) => {
  return request({
    url: '/gifts/option/add',
    method: 'post',
    data,
  });
};

// 修改慰问品选项
export const editGiftOption = (data) => {
  return request({
    url: '/gifts/option/edit',
    method: 'put',
    data,
  });
};

// 慰问品领取记录列表
export const getGiftRecordList = (params) => {
  return request({
    url: '/gifts/record/list',
    method: 'get',
    params: params,
  });
};

// 保存慰问品领取记录
export const addGiftRecord = (data) => {
  return request({
    url: '/gifts/record/add',
    method: 'post',
    data,
  });
};
